load("//bzl:cpp_library.bzl", "cpp_library")

package(default_visibility = ["//visibility:public"])

cpp_library(
    name = "blake2xb",
    srcs = [
        "Blake2xb.cpp",
    ],
    hdrs = [
        "Blake2xb.h",
    ],
    deps = [
        "//folly:range",
        "//folly/lang:bits",
        "@libsodium",
    ],
)

cpp_library(
    name = "lt_hash",
    srcs = [
        "LtHash.cpp",
    ],
    hdrs = [
        "LtHash.h",
    ],
    textual_hdrs = [
        "LtHash-inl.h",
    ],
    deps = [
        ":blake2xb",
        "//folly:cpu_id",
        "//folly:memory",
        "//folly:optional",
        "//folly:range",
        "//folly/crypto/detail:lt_hash_internal",
        "//folly/crypto/detail:math_operation_avx2_disable",  # @manual
        "//folly/crypto/detail:math_operation_simple",  # @manual
        "//folly/crypto/detail:math_operation_sse2_disable",  # @manual
        "//folly/io:iobuf",
        "//folly/lang:bits",
        "@libsodium",
    ],
)

cpp_library(
    name = "lt_hash_sse2",
    srcs = [
        "LtHash.cpp",
    ],
    hdrs = [
        "LtHash.h",
    ],
    textual_hdrs = [
        "LtHash-inl.h",
    ],
    deps = [
        ":blake2xb",
        "//folly:cpu_id",
        "//folly:memory",
        "//folly:optional",
        "//folly:range",
        "//folly/crypto/detail:lt_hash_internal",
        "//folly/crypto/detail:math_operation_avx2_disable",  # @manual
        "//folly/crypto/detail:math_operation_simple",  # @manual
        "//folly/crypto/detail:math_operation_sse2",  # @manual
        "//folly/io:iobuf",
        "//folly/lang:bits",
        "@libsodium",
    ],
)

cpp_library(
    name = "lt_hash_avx2",
    srcs = [
        "LtHash.cpp",
    ],
    hdrs = [
        "LtHash.h",
    ],
    textual_hdrs = [
        "LtHash-inl.h",
    ],
    deps = [
        ":blake2xb",
        "//folly:cpu_id",
        "//folly:memory",
        "//folly:optional",
        "//folly:range",
        "//folly/crypto/detail:lt_hash_internal",
        "//folly/crypto/detail:math_operation_avx2",  # @manual
        "//folly/crypto/detail:math_operation_simple",  # @manual
        "//folly/crypto/detail:math_operation_sse2",  # @manual
        "//folly/io:iobuf",
        "//folly/lang:bits",
        "@libsodium",
    ],
)
